<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script type="module" src="./1.js"></script>
  <!-- <script src="./src/part1/code/index.js"></script> -->
  <script>
    let node = function(val, left, right) {
      this.value = val;
      this.left = left;
      this.right = right;
    }
    let node1 = new node(1, null, null);
    let node2 = new node(2, node1, null);
    let node4 = new node(4, null, null);
    let node3 = new node(3, node2, node4);
    let node7 = new node(7, null, null);
    let node6 = new node(6, null, node7);
    let root = new node(5, node3, node6)
    let arr = []

    let center = (node)=> {
      if(!node) return;

      center(node.left);
      center(node.right);
      arr.push(node.value)
      console.log(`value: ${node.value}`)
      
    }
    let val = center(root)
    console.log('找到了 ', arr[3])
  </script>
</body>
</html>